var express = require('express');
var router = express.Router();
const axios = require("axios");
/* GET home page. */
router.get('/', function(req, res, next) {

  axios
    .get(
      "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx161d42f21bde379a&secret=35c576d99644f8a0d7568fea290178c3"
    )
    .then(res => {
      // handle success
      console.log('111');
      console.log(res.data.access_token);
    })
    .catch(error => {
      // handle error
      console.log(error);
    });


  res.render('index', { title: 'Express' });
});

module.exports = router;
